home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.cyberramp.net!news
- From: sinan@cyberramp.net (John Noland)
- Newsgroups: comp.lang.c
- Subject: Re: fflush and Visual C++
- Date: 22 Mar 1996 00:37:33 GMT
- Organization: Prose Software
- Message-ID: <4issod$jkf@newshost.cyberramp.net>
- References: <4idhv5$dnv@news.mhv.net> <314b173b.71056173@nntp.ix.netcom.com> <4ifuuf$fha@solutions.solon.com>
- NNTP-Posting-Host: ramp1-6.cyberramp.net
- X-Newsreader: WinVN 0.99.5
-
- In article <4ifuuf$fha@solutions.solon.com>, seebs@solutions.solon.com says...
- >
- >In article <314b173b.71056173@nntp.ix.netcom.com>,
- >Mike Rubenstein <miker3@ix.netcom.com> wrote:
- >>Perhaps because Visual C implements fflush() correctly. fflush() does
- >>not flush input buffers. fflush() with stdin as an argument results
- >>in undefined behavior.
- >
- >The first part of this is incorrect. fflush() may flush input buffers.
- >It may cause the program to abort. It may do nothing. But there's
- >nothing *wrong* with it choosing to discard pending input when invoked
- >on an input stream. Except that it's rude of an implementation to offer
- >a silent extension, it causes people to make mistakes.
-
- Sorry to keep getting myself in trouble, but...
-
- With Micrsoft's Visual C compiler, if the stream is open for input, fflush()
- clears the contents of the buffer. I don't have any thoughts on the ANSIness
- of this behavior, but that's the way the manual says it works. It also says
- the fflush() function negates the effect of any prior call to ungetc() against
- the stream. And then it has the mark saying this function is ANSI compliant.
- I gather PS's remarks about rudeness are correct?
-
- -John
-
-